mod[n] ket apply mod n to the value in the ket by n, leaving the coefficient unchanged if the ket is not a number, then return the empty ket |>
mod[1000] |1234567> |567>